import type { RouteRecordRaw } from "vue-router";

export interface UserState {
  token: string | null;
  menuRoutes: RouteRecordRaw[];
  avatar: string | null;
  username: string | null;
  buttons: [];
}

export interface UserStateFormResult {
  code: number;
  message: string;
  data: string;
  okay: boolean;
}

export interface UserStateInformationResult {
  code: number;
  message: string;
  data: {
    routes: [];
    buttons: [];
    roles: [];
    name: string;
    avatar: string;
  };
  ok: boolean;
}

export interface UserStateVo {
  // ID
  id: string | number;
  // 用户名称
  username: string;
  // 用户昵称
  nickname: string;
  // 用户密码
  password: string;
  // 用户盐值
  token: string | null | undefined;
}

export interface UserStateForm extends BaseEntity {
  // ID
  id?: string | number;
  // 用户名称
  username?: string;
  // 用户昵称
  nickname?: string;
  // 用户密码
  password?: string;
  // 用户盐值
  token?: string | null | undefined;
}

export interface UserStateQuery extends PageQuery {
  // ID
  id?: string | number;
  // IDs
  ids?: (string | number)[];
  // 用户名称
  username?: string;
  // 用户昵称
  nickname?: string;
  // 用户密码
  password?: string;
  // 用户盐值
  token?: string | null | undefined;
}

// ---------- ---------- ---------- 华丽的分割线 ---------- ---------- ----------

export interface loginForm {
  username: string;
  password: string;
}

export interface loginResponseData {
  code: number;
  data: string;
  message: string;
  ok: boolean;
}

// 登录接口返回数据类型
export interface loginResData {
  code: number;
  message: string;
  data: string;
  ok: boolean;
}

// 服务器返回用户信息相关的数据类型
export interface userResPonseDara {
  code: number;
  data: {
    records?: [];
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    nickname: string;
    avatar: string;
    avatar2: string;
  };
}

// 返回的角色信息
export interface ResGetrole {
  code: number;
  message: string;
  data: {
    assignRoles: [];
    allRolesList: [];
  };
}
// 给用户添加角色
export interface ResAllrole {
  roleIdList: number[];
  userId: number;
}
